<!DOCTYPE html>
<%@page contentType="text/html; charset=UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html>
<head>
<%@include file="headScript.jsp"%>
<script type="text/javascript" src="${pageContext.request.contextPath}/assets/js/sfc/acm1204script.js"></script> 
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
</head>
<body>
	<div class="wrapper">
		<!-- BEGIN Top-Bar -->
		<%@ include file="../fragments/header.jsp"%>
		<!-- END Top-Bar -->

		<div id="detail-area" class="clearfix">
			<!-- BEGIN SIDEMENU -->
			<div class="hidden-xs hidden-sm page-sidebar" id="side-menu-bar">
				<ul class="page-sidebar-menu">					
		<li class="info">
			<div class="clearfix">
				<div><strong>ยินดีต้อนรับ</strong></div>
				<div><i class="fa fa-user"></i> Admin </div>
				<div class="mt-10"><strong>คุณเข้าระบบครั้งล่าสุดเมื่อ</strong></div>
				<div class="mb-10"><i class="fa fa-clock-o"></i> 13 / 01 / 2558 14:00:00</div>
			</div>
		</li>
		<li class="active"><a href="javascript:void(0)" ><i class="fa fa-briefcase"></i> Agent Management <span class="arrow"></span></a>
			<ul class="sub-menu">
				<li><a href="javascript:void(0)" ><i class="fa fa-folder"></i> GA : General Agent <span class="arrow"></span></a>
					<ul class="sub-menu">
						<li><a href="${pageContext.request.contextPath}/content/ACM1101.jsp"><i class="fa fa-coffee"></i> AG </a></li>
						<li><a href="${pageContext.request.contextPath}/content/ACM11021.jsp"><i class="fa fa-coffee"></i> AL </a></li>
						<li><a href="${pageContext.request.contextPath}/content/ACM1103.jsp"><i class="fa fa-coffee"></i> AVP </a></li>
						<li><a href="${pageContext.request.contextPath}/content/ACM1104.jsp"><i class="fa fa-coffee"></i> VP </a></li>
					</ul>
				</li>
				<li class="active"><a href="javascript:void(0)" ><i class="fa fa-folder"></i> SFC <span class="arrow"></span></a>
					<ul class="sub-menu">
						<li><a href="${pageContext.request.contextPath}/content/ACM1201.jsp"><i class="fa fa-coffee"></i> AG : Financing Allowance </a></li>
						<li><a href="${pageContext.request.contextPath}/content/ACM1202.jsp"><i class="fa fa-coffee"></i> AG : Recruiting Award </a></li>
						<li><a href="${pageContext.request.contextPath}/content/ACM1203.jsp"><i class="fa fa-coffee"></i> MM : Incentive </a></li>
						<li><a href="${pageContext.request.contextPath}/content/ACM1204.jsp" class="active"><i class="fa fa-coffee"></i> O/E : Operation Expense </a></li>
					</ul>
				</li>
				<li><a href="javascript:void(0)" ><i class="fa fa-folder"></i> Summary <span class="arrow"></span></a>
					<ul class="sub-menu">
						<li><a href="${pageContext.request.contextPath}/content/ACM1301.jsp"><i class="fa fa-coffee"></i> GA - AG </a></li>
					</ul>
				</li>
			</ul>
		</li>
		<li><a href="javascript:void(0)"><i class="fa fa-briefcase"></i> Data Management <span class="arrow"></span></a>
			<ul class="sub-menu">
				<li><a href="javascript:void(0)"><i class="fa fa-folder"></i> SFC <span class="arrow"></span></a>
					<ul class="sub-menu">
						<li><a href="${pageContext.request.contextPath}/content/ACM2101.jsp"><i class="fa fa-coffee"></i> SFC Agent Structure </a></li>
					</ul>
				</li>
				<li><a href="javascript:void(0)"><i class="fa fa-folder"></i> Modify Data <span class="arrow"></span></a>
					<ul class="sub-menu">
						<li><a href="${pageContext.request.contextPath}/content/ACM2201.jsp"><i class="fa fa-coffee"></i> SFC Agent Structure </a></li>
					</ul>
				</li>
			</ul>
		</li>
		<li><a href="javascript:void(0)" ><i class="fa fa-briefcase"></i> Formula Management <span class="arrow"></span></a>
			<ul class="sub-menu">
				<li><a href="javascript:void(0)" ><i class="fa fa-folder"></i> SFC <span class="arrow"></span></a>
					<ul class="sub-menu">
						<li><a href="${pageContext.request.contextPath}/content/ACM3101.jsp"><i class="fa fa-coffee"></i> Recruiting Award Management </a></li>
					</ul>
				</li>
				<li><a href="javascript:void(0)" ><i class="fa fa-folder"></i> Adjustment <span class="arrow"></span></a>
					<ul class="sub-menu">
						<li><a href="${pageContext.request.contextPath}/content/ACM5101.jsp"><i class="fa fa-coffee"></i> Adjustment </a></li>
					</ul>
				</li>
			</ul>
		</li>
		<li><a href="javascript:void(0)" ><i class="fa fa-briefcase"></i> Report Management <span class="arrow"></span></a>
			<ul class="sub-menu">
				<li><a href="javascript:void(0)" ><i class="fa fa-folder"></i> Demo Report <span class="arrow"></span></a>
					<ul class="sub-menu">
						<li><a href="${pageContext.request.contextPath}/content/ACM4101.jsp"><i class="fa fa-coffee"></i> Report 1 </a></li>
						<li><a href="${pageContext.request.contextPath}/content/ACM4102.jsp"><i class="fa fa-coffee"></i> Report 2 </a></li>
						<li><a href="${pageContext.request.contextPath}/content/ACM4103.jsp"><i class="fa fa-coffee"></i> Report 3 </a></li>
						<li><a href="${pageContext.request.contextPath}/content/ACM4104.jsp"><i class="fa fa-coffee"></i> Report 4 </a></li>
						<li><a href="${pageContext.request.contextPath}/content/ACM4105.jsp"><i class="fa fa-coffee"></i> Report 5 </a></li>
						<li><a href="${pageContext.request.contextPath}/content/ACM4106.jsp"><i class="fa fa-coffee"></i> Report 6 </a></li>
					</ul>
				</li>
			</ul>
		</li>
		<li><a href="javascript:void(0)" ><i class="fa fa-briefcase"></i> Financial Management <span class="arrow"></span></a>
			<ul class="sub-menu">
				<li><a href="javascript:void(0)" ><i class="fa fa-folder"></i> Finance <span class="arrow"></span></a>
					<ul class="sub-menu">
						<li><a href="${pageContext.request.contextPath}/content/ACM5102.jsp"><i class="fa fa-coffee"></i> Adjustment </a></li>
						<li><a href="${pageContext.request.contextPath}/content/ACM5201.jsp"><i class="fa fa-coffee"></i> Tax Calculation </a></li>
						<li><a href="${pageContext.request.contextPath}/content/ACM5202.jsp"><i class="fa fa-coffee"></i> Tax Reduction </a></li>
					</ul>
				</li>
			</ul>
		</li>
		<li><a href="javascript:void()"><i class="fa fa-sign-out"></i> ออกจากระบบ </a></li>
				</ul>
			</div>
			
			<!-- End Side Menu -->
			<div class="col-sm-12 col-xs-12" id="right-side">
				<div id="navigator-bar">
					<i class="fa fa-home"></i> หน้าหลัก <i class="fa fa-angle-right ml-5 mr-5"></i> O/E : Operation Expense
				</div>
				<!--End navigator-bar-->			
				<div class="form-list clearfix" style="margin-top:-30px; margin-bottom:-75px;">
					<div class="search-box no-radius">
						<!-- header -->
						<div class="form-group clearfix search-header no-radius">
							<div class="pull-left">การคำนวณ Operation Expense</div>
							<div class="pull-right"><div id="hide-button"><i class="fa fa-chevron-circle-up"></i></div></div>
						</div>
					  	<!-- BOX-BODY -->
					  	<div id="box-body">
							<div class="form-group clearfix mt-20">
								<div class="col-sm-2"></div>
								<div class="pull-left mt-3" style="width:200px;margin-left: 50px;">
									<label id="#">เดือน</label>
									<select class="form-control" id="inputMonth" name="inputMonth">
										<option value="">-- เลือกเดือน --</option>
										<option value="01"> มกราคม </option>
										<option value="02"> กุมภาพันธ์ </option>
										<option value="03"> มีนาคม </option>
										<option value="04"> เมษายน </option>
										<option value="05"> พฤษภาคม </option>
										<option value="06"> มิถุนายน </option>
										<option value="07"> กรกฎาคม</option>
										<option value="08"> สิงหาคม</option>
										<option value="09"> กันยายน</option>
										<option value="10"> ตุลาคม</option>
										<option value="11"> พฤศจิกายน</option>
										<option value="12"> ธันวาคม</option>
									</select>
								</div>
								<div class="col-sm-2"></div>
								<div class="pull-left mt-3" style="width:200px">
									<label id="#">รหัสหัวหน้าสาขา</label>
									<input type="text" class="form-control" id= "inputPeNoMM"  name="inputPeNoMM" maxlength="9">
								</div>
							</div>
				  		</div>
							<!-- footer -->
							<div class="form-group mt-20 clearfix search-footer no-radius">
								<div class="col-sm-12 text-center">															
						 			<button type="button" class="btn btn-primary" onclick="searchData();"><i class="fa fa-search"></i> ค้นหา </button>
								</div>
					  		</div>					  
					 	<!-- END BOX-BODY -->
					</div>
				</div>
				<div class="form-list" style="padding:0px">
					<div class="form-list" id="form-list" >
						<form role="form" name="form" action="../ACM1203Srvl" method="POST">
							<div class="list-detail-area">						
								<table id="raDataTable" class="stripe hover cell-border" cellspacing="0" width="100%" align="center">
		        					<thead>
		            					<tr style="background-color: #132167; color:white; font-size: 0.9em; ">
											<th style="border-right: 1px solid #999; text-align: center;">ลำดับ</th>
											<th style="border-right: 1px solid #999; text-align: center;">รหัสพนักงาน</th>
											<th style="border-right: 1px solid #999; text-align: center;">ชื่อ - นามสกุล</th>
											<th style="border-right: 1px solid #999; text-align: center;">จัดการ</th>
		            					</tr>
		        					</thead> 				
		    					</table>
							</div>
						</form>
					</div>
					<!-- list-detail-area-->	
				</div>
				<!-- Start detail-area -->				
							
				<!-- ### Modal Popup ### -->
				<div class="modal fade" id="warningModal" tabindex="-1" role="dialog" aria-labelledby="warningModal" aria-hidden="true">
				  	  <div class="modal-dialog">
				        <div class="modal-content">
				            <div class="modal-header">
				            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				            <h4 class="modal-title">กรุณากรอกข้อมูลให้ถูกต้อง</h4>
				            </div>
				            <div class="modal-body">
				            	<span class="fa-stack fa-lg mr-10" style=" color:#FC0"> <i class="fa fa-exclamation-triangle fa-stack-2x"></i></span>
				            	<span id="modal_content"></span>
				            </div>
				            <div class="modal-footer">
				                <button type="button" class="btn btn-primary" data-dismiss="modal"><i class="glyphicon glyphicon-ok"></i> ตกลง</button>    
				        	</div>
				    	</div>
				  	</div>
				</div>
				<div class="modal fade" id="errorModal" tabindex="-1" role="dialog" aria-labelledby="confirmModal" aria-hidden="true">
				    <div class="modal-dialog" style="width: 420px;">
				        <div class="modal-content">
				            <div class="modal-header">
				            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				            <h4 class="modal-title">ผิดพลาด</h4>
				            </div>
				            <div class="modal-body">
				            	<span class="fa-stack fa-lg mr-10" style=" color:#FC0"> <i class="fa fa-exclamation-triangle fa-stack-2x"></i></span>
				            	<span>เกิดข้อผิดพลาด ไม่พบข้อมูลที่ใช้ในการคำนวณ</span>
				            </div>
				            <div class="modal-footer" style="text-align: center;">
				                <button type="button" class="btn btn-primary" data-dismiss="modal"><i class="fa fa-times"></i> ตกลง</button>
				        	</div>
				    	</div>
				  	</div>
				</div>
				<div class="modal fade" id="errorModal2" tabindex="-1" role="dialog" aria-labelledby="confirmModal" aria-hidden="true">
				    <div class="modal-dialog" style="width: 420px;">
				        <div class="modal-content">
				            <div class="modal-header">
				            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				            <h4 class="modal-title">ผิดพลาด</h4>
				            </div>
				            <div class="modal-body">
				            	<span class="fa-stack fa-lg mr-10" style=" color:#FC0"> <i class="fa fa-exclamation-triangle fa-stack-2x"></i></span>
				            	<span>เกิดข้อผิดพลาด ไม่พบข้อมูลที่ใช้ในการคำนวณ</span>
				            </div>
				            <div class="modal-footer" style="text-align: center;">
				                <button type="button" class="btn btn-primary" data-dismiss="modal"><i class="fa fa-times"></i> ตกลง</button>
				        	</div>
				    	</div>
				  	</div>
				</div>
				<div class="modal fade" id="confirmSaveModal" tabindex="-1" role="dialog" aria-labelledby="confirmModal" aria-hidden="true">
				    <div class="modal-dialog">
				        <div class="modal-content">
				            <div class="modal-header">
				            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				            <h4 class="modal-title">ยืนยันการบันทึกข้อมูลกำหนดวันที่ของระบบ</h4>
				            </div>
				            <div class="modal-body">
				            	<span class="fa-stack fa-lg mr-10" style=" color:#FC0"> <i class="fa fa-exclamation-triangle fa-stack-2x"></i></span>
				            	<span id="modal_content_confirmSaveModal"></span>
				            </div>
				            <div class="modal-footer">
				                <button onclick="SaveCommand()" type="button"  class="btn btn-primary"><i class="fa fa-floppy-o"></i> ยืนยัน</button>
				                <button onclick="cancel()"  type="button" class="btn btn-danger" data-dismiss="modal"><i class="glyphicon glyphicon-floppy-remove"></i> ยกเลิก</button>
				        	</div>
				    	</div>
				  	</div>
				</div>
				<!-- ### END Modal Popup ### -->
				<!-- Pop up details2 -->
				<input type="hidden" value="" id="vaClosYm">
				<input type="hidden" value="" id="vaPoNo">
				<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true" id="popUpDetail2">
  					<div class="modal-dialog modal-lg">
    					<div class="modal-content">
      						<div class="modal-header">
        						<h4 class="modal-title" id="exampleModalLabel"> รายละเอียด Operation Expense </h4>
				      		</div>
				      		<div class="modal-body">
				      			<span id="vaIncentive"></span>
								<div><label>Organization Part</label></div>
								<div style="margin-left: 30px;">Active Pro. <span id="vaActivePro" style="margin-left: 50px;"></span></div>
								<div style="margin-left: 30px;">Grader</div>
								<div> 					      			
								<span id="detailsTableRA"></span>
								
							<br/>
							<div><label>Production Part</label></div>
							<div style="margin-left: 30px;">{ [ PC x 1% ] + [ ARYP(2<sup>nd</sup> ~ 5<sup>th</sup>) x 0.5% ] } x Ratio</div>
							<div> 	
							
								<span id="detailsTableRA2"></span><br/>
								<div style="text-align: right;"><label>รวมรับ O/E ทั้งสิ้น</label> <span id="vnTotalOE"></span><span id="vnRecalOE"></span><span id="vnNetOE"></span> บาท</div> 
								<div style="margin-left: 760px;color: red;"><label></label> <span id="vaRemark"></span></div> 
								<div style="text-align: right;">
									<button type="submit" class="btn btn-primary" data-dismiss="modal"><i class="fa fa-times"></i> ปิดรายละเอียด </button>
								</div>
				      		</div>
    					</div>
  						</div>
					</div>
				</div>
			</div>
			<!-- Pop up details -->
			<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true" id="popUpDetail">
  					<div class="modal-dialog modal-lg">
    					<div class="modal-content">
      						<div class="modal-header">
        						<h4 class="modal-title" id="exampleModalLabel"> รายละเอียด PC </h4>
				      		</div>
				      		<div class="modal-body">
				      			<span id="vaIncentive"></span>
				      				<table id="raDataTableDetailPC" class="stripe hover cell-border" cellspacing="0" width="100%" align="center">
		        					<thead>
		            					<tr style="background-color: #132167; color:white; font-size: 0.9em; ">
											<th style="border-right: 1px solid #999; text-align: center;">ลำดับ</th>
											<th style="border-right: 1px solid #999; text-align: center;">CLOS_YM</th>
											<th style="border-right: 1px solid #999; text-align: center;">PE_NO_COL</th>
											<th style="border-right: 1px solid #999; text-align: center;">PO_NO</th>
											<th style="border-right: 1px solid #999; text-align: center;">AFYP</th>
											<th style="border-right: 1px solid #999; text-align: center;">ARYP2</th>
											<th style="border-right: 1px solid #999; text-align: center;">PC</th>
		            					</tr>
		            				</thead> 
		            					<tr>
											<td style="border-right: 1px solid #999; text-align: center; border-left: 1px solid #999; border-bottom: 1px solid #999;"><span id="spSeq"></span></td>
											<td style="border-right: 1px solid #999; text-align: center; border-bottom: 1px solid #999;"></td>
											<td style="border-right: 1px solid #999; text-align: center; border-bottom: 1px solid #999;"></td>
											<td style="border-right: 1px solid #999; text-align: center; border-bottom: 1px solid #999;"></td>
											<td style="border-right: 1px solid #999; text-align: right; border-bottom: 1px solid #999;"></td>
											<td style="border-right: 1px solid #999; text-align: right; border-bottom: 1px solid #999;"></td>
											<td style="border-right: 1px solid #999; text-align: right; border-bottom: 1px solid #999;"></td>										
		            					</tr>				
		    					</table><br/>
								<span id="vaRemark"></span>
								<div style="text-align: right;">
									<button type="submit" class="btn btn-primary" data-dismiss="modal"><i class="fa fa-times"></i> ปิดรายละเอียด  </button>
								</div>
				      		</div>
    					</div>
  					</div>
				</div>
				<!-- End pop up details -->
			<div id="footer-detail">Copyright © สงวนลิขสิทธิ์ พ.ศ.2558 โดยบริษัท เอสแคป โซลูชั่นส์ จำกัด</div>
	</div>
	</div>
</div>
</body>
</html>